package com.example.yang.yixin.Activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.example.yang.yixin.R;

import java.util.Timer;
import java.util.TimerTask;

public class welcomeActivity extends BaseActivity{
private Timer mTimer;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        init();
    }
    protected void init(){
        mTimer=new Timer();
        mTimer.schedule(new TimerTask() {
            @Override
            public void run() {
              // toMain();
                toLogin();
            }
        },3*1000);
    }
    private void toMain(){
        Intent intent=new Intent(welcomeActivity.this,MainActivity.class);
        startActivity(intent);
        finish();
    }
    private void toLogin(){
        Intent intent=new Intent(welcomeActivity.this,LoginActivity.class);
        startActivity(intent);
        finish();
    }
}
